package athabasca.ca.model;

import java.util.ArrayList;

public class Device
{
	private long deviceId;
	private ArrayList<FeatureConcept> availableFeatures;
	
	public Device ()
	{
		availableFeatures = new ArrayList<FeatureConcept> ( );
	}
	
	public Device(long deviceId)
	{
		this.setDeviceId(deviceId);
		availableFeatures = new ArrayList<FeatureConcept> ( ) ;
	}
	
	public Device(long deviceId, FeatureConcept[] avFeatures)
	{
		this.setDeviceId (deviceId);
		
		availableFeatures = new ArrayList<FeatureConcept> ( ) ;
		for ( FeatureConcept fC : avFeatures )
			availableFeatures.add( fC );
	}

	public long getDeviceId()
	{
		return deviceId;
	}

	public void setDeviceId(long deviceId)
	{
		this.deviceId = deviceId;
	}
	
	public FeatureConcept[] getAvailableFeatures()
	{
		return ( FeatureConcept [ ] ) availableFeatures.toArray ( new FeatureConcept [ availableFeatures.size ( ) ] );
	}
	
	public void addFeature ( FeatureConcept fC )
	{
		availableFeatures.add( fC );
	}
	
	public boolean removedFeature ( FeatureConcept fC )
	{
		return availableFeatures.remove( fC );
	}
	
	public void addAvailableFeatures( FeatureConcept[] avFeatures )
	{
		for( FeatureConcept fC : avFeatures )
		{
			availableFeatures.add ( fC );
		}
	}
	
}
